import Vue from 'vue'
import App from './App'
import Storage from "./common/js/storage";
import moment from "dayjs";
import message from "./components/public/bobo-message/bobo-message";
import Router from "./common/js/vue-router-uni/index";
import store from "./store/index";
import http from "./common/api/http";
import HeadShadow from "@/components/public/head-shadow/index"
import {
	getDictDataList,
	getDictLabel
} from "./utils"

Vue.prototype.$getDictDataList = function (key) {
	return getDictDataList(key, store.state.User.dictData)
}
Vue.prototype.$getDictLabel = function (key, val) {
	return getDictLabel(key, val, store.state.User.dictData)
}
Vue.prototype.$hasPermission = function (v) {
	return store.state.User.userInfo.is_super || (store.state.User.permissions || []).findIndex(i => i == v) != -1;
}
Vue.config.productionTip = false
Vue.prototype.$moment = moment;
Vue.prototype.$store = store;
Vue.prototype.$storage = Storage;
Vue.prototype.$http = http;

Vue.prototype.$ERR_OK = 200;
Vue.component("Message", message);
Vue.component("HeadShadow", HeadShadow);

App.mpType = 'app'

Vue.use(Router, {
	mode: "loose",
	tabBars: [
		"/pages/tabbar-pages/tabbar-pages",
		"pages/tabbar-pages/tabbar-pages",
	],
});
const app = new Vue({
	...App
})
app.$mount()